Ant-Line

Share

What is an Ant-Line?

An ant-line is a term for the animated, dashed, black-and-white outline that contours the selected area in an image-editing program when there are pixels selected on the canvas. I suppose most people spell it "ant line," but I prefer to join the words with a dash to make it clear it's a line of ants.

A rectangular selection over a white background, and a circle-shaped selection over black background, indicating by a "marching ants" animation on their perimeter.
An animated GIF of an ant-line. Observe how the ant-line is visible in front of both light and dark backgrounds.

The ant-line was invented in 1983 by Bill Atkinson for an application called MacPaint. Originally, he made the selected area invert its colors to indicate it was selected, but this was later replaced by the ant-line effect that exists in image editors to this day. When he showed the effect to his colleague, Rod Perkins, Rod described ti as resembling "marching ants."1 Note: the phrase "ant line" isn't mentioned in the cited article, however some people do call it that, knowing its history or not, simply because it looks like that.

Observations

Binary vs. Fractional Selections

At the time the ant-line was invented, image editors worked with binary selection (1 bit), where each pixel is either selected or not selected. This makes the ant-line very straightforward to implement, as it contours the selected pixels. Today, image editors work with fractional selection, or "selection masks" (typically 8 bit), where selected areas can be blurred (feathered), so a single pixel can be 50% selected, or even 1% selected, and effects are masked just like if this selection percentage was alpha transparency or layer opacity.

In fractional selection, it's not obvious where the ant-line is supposed to go. Does the ant-line contour only the 100% selected pixels? Does it split the pixels more than 50% selected from those less than 50%? Or does it contour every pixel that has more than 0% selection?

In Krita, the ant-line contours all area that has more than 0% selection, which I believe makes most sense. By doing this, the ant-line contours all pixels that can be modified when an action is applied, even if they're only modified by 1% of the effect. All pixels outside the ant-line are effectively read-only and won't be modified by any filters or brushes used on the canvas.

Mask Alternative

In applications with support for fractional selection, it's sometimes possible to display the selected area as a "mask" effect overlaid over the canvas, which better indicates pixels that are semi-selected.

In Krita, this functionality can be activated through Select -> Show Global Selection Mask on the menubar. This makes a special "Selection Mask" appear on the layer stack, which, when selected, displays a red mask over non-selected pixels, and a semi-transparent red mask over semi-selected pixels according to their selection percentage.

References

  1. https://www.folklore.org/MacPaint_Evolution.html (accessed 2024-07-02) ↩︎

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *